package com.ticket.service.impl;

import com.ticket.dao.ContestDao;
import com.ticket.dao.MovieDao;
import com.ticket.entity.ContestCollect;
import com.ticket.entity.HomePage;
import com.ticket.entity.MovieCollect;
import com.ticket.service.ContestService;
import com.ticket.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author 全谢民
 * @version 8.0
 * @description: TODO 赛事service的实现类
 * @date 2023/10/10 20:00
 */
public class ContestServiceImpl implements ContestService {
    static ContestDao cd;

    static {
        SqlSession sqlSession = MybatisUtil.getSqlSession();
        cd = sqlSession.getMapper(ContestDao.class);
    }

    /*
     * @author 全谢民
     * @description TODO 前端首页体育赛事
     * @date 2023/10/13 21:31
     */
    @Override
    public List<HomePage> selHomeContestList() {
        List<HomePage> homePageList = cd.selHomeContestList();
        return homePageList;
    }

    /*
     * @author 全谢民
     * @description TODO 查询用户收藏列表的赛事收藏
     * @date 2023/10/10 20:01
     */
    @Override
    public List<ContestCollect> selContestCollectList(int userId) {
        List<ContestCollect> collectList = cd.selContestCollectList(userId);
        return collectList;
    }


}
